Skip to content

Conversation

@heyitsaamir
Copy link
Collaborator

Original Payload:

{
   "text":"my pet's name is barnie!",
   "textFormat":"plain",
   "type":"message",
   "timestamp":"2025-10-16T23:15:20.113832Z",
   "id":"1760656520090",
   "channelId":"msteams",
   "serviceUrl":"https://smba.trafficmanager.net/amer/56653e9d-2158-46ee-90d7-675c39642038/",
   "from":{
      "id":"29:1J7sNKMNCijOoy412liJJHxliedKeLKozaInQ6ZSToFi_aTcVuoXJTfkLpwZ8yuWNKhJ4_4N3fTyxucoBHKYTDg",
      "name":"",
      "aadObjectId":"4816e27f-5665-4904-a182-f74d3bd509ac"
   },
   "conversation":{
      "isGroup":true,
      "conversationType":"groupChat",
      "tenantId":"56653e9d-2158-46ee-90d7-675c39642038",
      "id":"19:H2Z6fKe6bek72oiHV9TgOtn2CMO28CC1kdHIThQPxa81@thread.v2"
   },
   "recipient":{
      "id":"28:9707ff8c-f4e0-47c4-beb6-a10d61e7e7f7",
      "name":"aamirjtester"
   },
   "entities":[
      {
         "mentioned":{
            "id":"28:9707ff8c-f4e0-47c4-beb6-a10d61e7e7f7",
            "name":"ai-test"
         },
         "type":"mention"
      },
      {
         "locale":"en-US",
         "timezone":"America/Los_Angeles",
         "type":"clientInfo"
      },
      {
         "id":"COPILOT",
         "type":"ProductInfo"
      }
   ],
   "channelData":{
      "tenant":{
         "id":"56653e9d-2158-46ee-90d7-675c39642038"
      },
      "productContext":"COPILOT"
   },
   "locale":"en-US",
   "localTimezone":"America/Los_Angeles"
}

Error:

[ERROR] @teams/app.HttpPlugin [
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "literal_error",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "ClientInfoEntity",
[ERROR] @teams/app.HttpPlugin       "type"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Input should be 'clientInfo'",
[ERROR] @teams/app.HttpPlugin     "input": "ProductInfo",
[ERROR] @teams/app.HttpPlugin     "ctx": {
[ERROR] @teams/app.HttpPlugin       "expected": "'clientInfo'"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/literal_error"
[ERROR] @teams/app.HttpPlugin   },
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "literal_error",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "MentionEntity",
[ERROR] @teams/app.HttpPlugin       "type"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Input should be 'mention'",
[ERROR] @teams/app.HttpPlugin     "input": "ProductInfo",
[ERROR] @teams/app.HttpPlugin     "ctx": {
[ERROR] @teams/app.HttpPlugin       "expected": "'mention'"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/literal_error"
[ERROR] @teams/app.HttpPlugin   },
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "missing",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "MentionEntity",
[ERROR] @teams/app.HttpPlugin       "mentioned"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Field required",
[ERROR] @teams/app.HttpPlugin     "input": {
[ERROR] @teams/app.HttpPlugin       "id": "COPILOT",
[ERROR] @teams/app.HttpPlugin       "type": "ProductInfo"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/missing"
[ERROR] @teams/app.HttpPlugin   },
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "literal_error",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "MessageEntity",
[ERROR] @teams/app.HttpPlugin       "type"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Input should be 'https://schema.org/Message'",
[ERROR] @teams/app.HttpPlugin     "input": "ProductInfo",
[ERROR] @teams/app.HttpPlugin     "ctx": {
[ERROR] @teams/app.HttpPlugin       "expected": "'https://schema.org/Message'"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/literal_error"
[ERROR] @teams/app.HttpPlugin   },
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "literal_error",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "AIMessageEntity",
[ERROR] @teams/app.HttpPlugin       "type"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Input should be 'https://schema.org/Message'",
[ERROR] @teams/app.HttpPlugin     "input": "ProductInfo",
[ERROR] @teams/app.HttpPlugin     "ctx": {
[ERROR] @teams/app.HttpPlugin       "expected": "'https://schema.org/Message'"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/literal_error"
[ERROR] @teams/app.HttpPlugin   },
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "literal_error",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "StreamInfoEntity",
[ERROR] @teams/app.HttpPlugin       "type"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Input should be 'streaminfo'",
[ERROR] @teams/app.HttpPlugin     "input": "ProductInfo",
[ERROR] @teams/app.HttpPlugin     "ctx": {
[ERROR] @teams/app.HttpPlugin       "expected": "'streaminfo'"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/literal_error"
[ERROR] @teams/app.HttpPlugin   },
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "literal_error",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "CitationEntity",
[ERROR] @teams/app.HttpPlugin       "type"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Input should be 'https://schema.org/Message'",
[ERROR] @teams/app.HttpPlugin     "input": "ProductInfo",
[ERROR] @teams/app.HttpPlugin     "ctx": {
[ERROR] @teams/app.HttpPlugin       "expected": "'https://schema.org/Message'"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/literal_error"
[ERROR] @teams/app.HttpPlugin   },
[ERROR] @teams/app.HttpPlugin   {
[ERROR] @teams/app.HttpPlugin     "type": "literal_error",
[ERROR] @teams/app.HttpPlugin     "loc": [
[ERROR] @teams/app.HttpPlugin       "message",
[ERROR] @teams/app.HttpPlugin       "entities",
[ERROR] @teams/app.HttpPlugin       2,
[ERROR] @teams/app.HttpPlugin       "SensitiveUsageEntity",
[ERROR] @teams/app.HttpPlugin       "type"
[ERROR] @teams/app.HttpPlugin     ],
[ERROR] @teams/app.HttpPlugin     "msg": "Input should be 'https://schema.org/Message'",
[ERROR] @teams/app.HttpPlugin     "input": "ProductInfo",
[ERROR] @teams/app.HttpPlugin     "ctx": {
[ERROR] @teams/app.HttpPlugin       "expected": "'https://schema.org/Message'"
[ERROR] @teams/app.HttpPlugin     },
[ERROR] @teams/app.HttpPlugin     "url": "https://errors.pydantic.dev/2.11/v/literal_error"
[ERROR] @teams/app.HttpPlugin   }
[ERROR] @teams/app.HttpPlugin ]

Copilot AI review requested due to automatic review settings October 16, 2025 23:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for a new ProductInfo entity type so incoming activities containing {"type": "ProductInfo"} no longer fail validation and improves debugging around activity parsing errors.

  • Introduces ProductInfoEntity model and registers it in the entity union and package exports.
  • Adds debug logging of the original request payload on validation errors.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/apps/src/microsoft/teams/apps/http_plugin.py Adds debug log of original payload to aid troubleshooting validation errors.
packages/api/src/microsoft/teams/api/models/entity/product_info_entity.py Defines the new ProductInfoEntity model.
packages/api/src/microsoft/teams/api/models/entity/entity.py Registers ProductInfoEntity in the Entity discriminated union list.
packages/api/src/microsoft/teams/api/models/entity/init.py Exports ProductInfoEntity via the package’s public API.

@heyitsaamir heyitsaamir merged commit d5eedca into main Oct 17, 2025
8 of 9 checks passed
@heyitsaamir heyitsaamir deleted the aamirj/copilotFix branch October 17, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants